package com.minhua.jijiehao2.mainframe.circle.productTypeActivity.impl

import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.ProductTypeBean
import com.minhua.jijiehao2.http.*
import com.minhua.jijiehao2.mainframe.circle.productTypeActivity.imp.IProductTypeModel

class ProductTypeModel : IProductTypeModel {
    override fun getProductTypes(map: ParamsMap, callBack: CallBack<List<ProductTypeBean>>) {
        HttpController<List<ProductTypeBean>>().doHttp(
                ApiClient.getInstance().api.getAllProductType(map.toRequestBody()),
                object : BaseSubscriber<List<ProductTypeBean>>() {
                    override fun dealData(t: BaseBean<List<ProductTypeBean>>) {
                        super.dealData(t)
                        callBack.onSuccess(t)
                    }
                }
        )
    }
}